package com.example.service.Impl;

import com.example.mapper.ClassMapper;
import com.example.pojo.Group;
import com.example.pojo.TeachingClass;
import com.example.pojo.TeachingStudentInClass;
import com.example.service.ClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ClassServiceImpl implements ClassService {
    @Autowired
    private ClassMapper classMapper;
    //创建
    @Override
    public void createClass(TeachingClass teachingClass) {
        classMapper.createTeachingClass(teachingClass);
    }

    //修改
    @Override
    public void updateClass(TeachingClass teachingClass) {
        classMapper.updateTeachingClass(teachingClass);
    }

    //查询
    @Override
    public TeachingClass query(String name) {
        TeachingClass teachingClass = classMapper.queryByName(name);
        return teachingClass;

    }
    //分配教师
    @Override
    public void assignTeacher(Integer id,String name) {
        classMapper.assignTeacherToTeachingClass(id,name);
    }
    //关联学生
    @Override
    public void connectStudent(TeachingStudentInClass teachingStudentInClass) {
        classMapper.assignStudent(teachingStudentInClass);
    }
    //创建小组
    @Override
    public void createGroup(Group group) {
        classMapper.createGroup(group);
    }
}
